<template>
  <el-dialog :visible.sync="dialogVisible" width="70%">
    <div class="flex_start" slot="title">
      <b>审批历史详情</b>
      <div class="white_f success_bg f12 success flex_start ml10" v-if="processStatus == 7">
        <i class="el-icon-circle-check f16"></i>
        <span class="">批准通过并签名成功，工作流关闭</span>
      </div>
    </div>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="updateTime" label="处理时间" width="180"></el-table-column>

      <el-table-column prop="type" label="工作流节点" width="100">
        <template slot-scope="scope">
          <span class="main_co">{{ progressNameTypes[scope.row.type] }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="type" label="签名状态" width="100">
        <template slot-scope="scope">
          <span class="main_co">
            {{ scope.row.isSign == '1' ? '已签名' : '待签名' }}
          </span>
        </template>
      </el-table-column>
      <el-table-column prop="result" label="处理结果" width="140">
        <template slot-scope="scope">
          <div :class="{ error_f: scope.row.checkStatus == '2', success_f: scope.row.checkStatus == '1' }">
            {{ scope.row.checkStatus == '1' ? '通过' : scope.row.checkStatus == '2' ? '拒绝' : '' }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="content" label="处理意见"></el-table-column>
      <el-table-column prop="createDeptName" label="处理人所在部门" width="200"></el-table-column>
      <el-table-column prop="createUserName" label="处理人" width="200"></el-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
export default {
  props: {
    processStatus: String,
    guifanFilesProcessRecordList: Array,
  },
  data() {
    return {
      dialogVisible: false,
      codes: {
        1: '批准',
        2: '评审',
        3: '审核',
        4: '编制',
      },
      tableData: [],
    }
  },
  mounted() {},
  methods: {
    init() {
      this.tableData = []
      console.log(this.guifanFilesProcessRecordList)
      this.guifanFilesProcessRecordList.forEach((item) => {
        if (item.checkStatus > 0 || item.type == 0) {
          this.tableData.push(item)
        }
      })
      this.dialogVisible = true
    },
    close() {
      this.$emit('close')
    },
  },
}
</script>

<style scoped="scoped">
.success {
  height: 32px;
  padding: 0px 10px;
  border-radius: 3px;
}
</style>
